from abc import abstractmethod, ABCMeta

from keras import Input

from entity.model_describe import ModelDescribe


class BaseLayer(metaclass=ABCMeta):
    def persistence(self, model_list_line: list, train_id: int) -> ModelDescribe:
        m = ModelDescribe()
        m.model_layer_id = model_list_line[0]
        m.train_id = train_id
        return m

    def check(self, model_list_line: list, models: list = None) -> bool:
        return False

    @abstractmethod
    def transfer(self, model_list_line: list, inputs: Input, models: list = None):  # model_list_line to functional model layer
        pass
